﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ListViewDemo.view;

namespace ListViewDemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public Person person1, person2;
        public MainWindow()
        {
            InitializeComponent();
            person1 = new() { Name = "tom", Age = 22 };
            person2 = new() { Name = "alice", Age = 16 };
            uiPersonView.uiPerson1.DataContext = person1;
            uiPersonView.uiPerson2.DataContext = person2;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ViewA.bhClasses.Add(new () { BHID = 8, ImgPath = "/res/08-松散-9.png",     BHName = "松散",     ShortKey = "9" });
        }

        private void BtnListDel_Click(object sender, RoutedEventArgs e)
        {
            var n = ViewA.lvBHClass.SelectedIndex;
            //var n = ViewA.bhClasses.Count - 1;
            ViewA.bhClasses.RemoveAt(n);

        }
    }
}